1. Field of the Invention
The present invention relates to a coding/decoding apparatus capable of achieving highly efficient coding of input image data.
2. Description of the Related Art
Moving image coding methods are classified into three representative methods: an interframe differential coding method; a motion compensation interframe differential coding method and an intraframe coding method. In practice, one picture is divided into a plurality of blocks, and such a moving image coding method is applied to each of the blocks.
The interframe differential coding method is intended to code the difference between a block to be coded and a block which occupies a spatially identical position in the previous frame. Since the stronger the correlation between frames, the closer to zero the difference value between the blocks, the interframe differential coding method can achieve a higher compression ratio for a lower-activity image.
The motion compensation interframe differential coding method is a modification of the interframe differential coding method into which motion compensation is introduced. In the motion compensation interframe differential coding method, a difference value is found between a block contained in one frame and the most approximate block selected from among neighboring blocks surrounding a block which occupies a spatially identical position in the previous frame, and the difference value is coded.
For example, difference data is subjected to discrete cosine transform, and after the resultant transform coefficient is quantized, Huffman coding is performed. Even if a moving object is present in a picture, the difference value obtained from the moving object can be made small. Accordingly, the motion compensation interframe differential coding method can achieve a high compression ratio even for a high-activity image.
The intraframe coding method is intended to perform coding within only a single picture. Specifically, an image of interest is directly subjected to discrete cosine transform, and after the resultant transform coefficient is quantized, Huffman coding is performed. If either of the aforesaid difference-value coding methods, i.e., the interframe differential coding method or the motion compensation interframe differential coding method, is employed with an interframe correlation small, the process of finding the difference value causes an increase in a dynamic range, and the amount of information to be processed increases. The intraframe coding method does not involve such a problem.
The intraframe coding method is suited to coding of an image immediately after a scene change, whereas the motion compensation interframe differential coding method is best suited to coding of ordinary low-activity moving images.
However, in the motion compensation interframe differential coding method, if a still background is contained in a block, a detection error occurs and the compression ratio is lowered. More specifically, a matching computation for detection of a motion vector is performed on the assumption that the still background is relatively moving with respect to a moving object. As a result, if the moving object and the background prevail in each block, the effect of motion compensation decreases and, in the worst case, serves as an impairment factor. In other words, if an accurate motion compensation is applied to a moving object, the motion compensation is performed on the assumption that a background image is moving, and this process of the motion compensation increases the amount of generated codes.